/*
 * Copyright (c) 2009-2013 EvTech Project
 * All rights reserved.
 * 
 * This file is part of Game packet.
 *
 * Game packet is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 *
 * Game packet is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Game packet.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package fi.honkalampisaatio.sound;

public class MidiElement implements Comparable<MidiElement> {
	private String currentMidiInstrumentName;
	private int midiValue;
	private int velocity;
	private long currentTimeMillis;

	public MidiElement(String currentMidiInstrumentName,  
			int midiValue,int velocity, long currentTimeMillis) {
		this.currentMidiInstrumentName = currentMidiInstrumentName;
		this.midiValue = midiValue;
		this.velocity = velocity;
		this.currentTimeMillis = currentTimeMillis;
	}

	public String getCurrentMidiInstrumentName() {
		return currentMidiInstrumentName;
	}

	public void setCurrentMidiInstrumentName(String currentMidiInstrumentName) {
		this.currentMidiInstrumentName = currentMidiInstrumentName;
	}

	public int getMidiValue() {
		return midiValue;
	}

	public void setMidiValue(int midiValue) {
		this.midiValue = midiValue;
	}

	public int getVelocity() {
		return velocity;
	}

	public void setVelocity(int velocity) {
		this.velocity = velocity;
	}

	public long getCurrentTimeMillis() {
		return currentTimeMillis;
	}

	public void setCurrentTimeMillis(long currentTimeMillis) {
		this.currentTimeMillis = currentTimeMillis;
	}

	@Override
	public int compareTo(MidiElement me) {
		if(me.getCurrentTimeMillis()==this.getCurrentTimeMillis()) {
			return 0;
		}
		if(me.getCurrentTimeMillis()<this.getCurrentTimeMillis()) {
			return 1;
		}
		else {
			return -1;
		}
	}
}
